export default {
  state:{
    appName: 'Datuo Frame',
    themeColor: '#545c64',
    oldThemeColor: '#545c64',
    collapse:false,
    menuRouteLoadded:false
  },
  getters: {
    collapse(state){// 对应着上面state
      return state.collapse
    }
  },
  mutations: {
    onCollapse(state) {  // 改变收缩状态
      state.collapse = !state.collapse
    },
    themeColor(state,themeColor) {
      state.themeColor = themeColor;
    },
    oldThemeColor(state,oldThemeColor) {
      state.oldThemeColor = oldThemeColor;
    },
    menuRouteLoadded(state,menuRouteLoadded) {
      state.menuRouteLoadded = menuRouteLoadded;
    }
  },
  actions:{
    onThemeChange({commit,state},data){
      commit('themeColor',data.themeColor);
      commit('oldThemeColor',data.oldThemeColor);
    }
  }
}
